package com.zrt.pad.datasource;

import java.util.ArrayList;
import java.util.List;

import android.util.Log;
import com.zrt.pad.datasource.bean.SysOption;
import com.zrt.pad.datasource.bean.UsrUser;
import com.zrt.pad.network.NetworkManager;

public class DataSourceHelper {
	/**
	 * 有网络操作，必须开启新的线程
	 * 
	 * @throws Exception
	 */
	
	public static boolean initSysOption() throws Exception { 
		SysOption[] options = NetworkManager.nm.getSysOption();
		if (options == null) {
			return false;
		}
		
		DataSourceInstance.instance.saveSysOption(options);
		return true;
	}
	
	
	public static boolean initUsrUser() throws Exception { 
		UsrUser[] users = NetworkManager.nm.getUsrUser();
		if (users == null) {
			return false;
		}
		
		DataSourceInstance.instance.saveUsrUser(users);
		return true;
	}
	
	//服务员登录
	public static boolean UserCheckIn() throws Exception{
		boolean bsucess = NetworkManager.nm.UserCheckIn();
		return bsucess;
	}
	
}
